﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" Inherits="System.Web.Mvc.ViewPage<DeklaritModel.ClienteDataSet>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">Work with</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<script type="text/javascript">
		function goToPage(pageIndex) {
			$("#CurrentPage").val(pageIndex);

			submitForm(true);
		}
		function expandCollapse(pageIndex, rowIndex, expand) {
			$("#CurrentPage").val(pageIndex);
			$("#ExpandRecords").val(expand);
			$("#RowIndex").val(rowIndex);

			submitForm(true);
		}

        function submitForm(ajax) {
		    var form = document.getElementById('ClienteWorkWithForm');
            if(ajax){
				document.getElementById('ClienteWorkWithSubmit').click();
            }else{
				form.submit();
            }
        }
        function DK_js_return( V) 
		{
			var changed=false; 
			if (opener != null) 
			{ if (opener.DKPARAMETERS != null) 
				{
					if (opener.DKPARAMETERS[0].type != 'hidden') 
					{
						num = 0;    
						while (opener.DKPARAMETERS.length > num)
						{
							if (opener.DKPARAMETERS[num] != null && V[num]!= null )
							{
								if (opener.DKPARAMETERS[num].tagName=="SPAN")
								{
									opener.DKPARAMETERS[num].innerHTML = V[num]; 
								}
								else
								{
									opener.DKPARAMETERS[num].value = V[num]; 
								}
							}
							num++;
						}
						changed = true;
						opener.DKPARAMETERS[0].focus(); 
					} 
				}
			} 
			self.close();
		}
	</script>

    <table width="100%">
        <tr>
            <td align="right">
                <a title="<%= Deklarit.Resources.Resources.CreateNew %>" href="<%= Url.Action("Create") %>">
                    <img style="border-style: none;" title="<%= Deklarit.Resources.Resources.CreateNew %>"
                        alt="<%= Deklarit.Resources.Resources.CreateNew %>" src="<%= (string)Session["ThemePath"] %>Images/new.gif" /></a>
                <%= Html.ActionLink(Deklarit.Resources.Resources.CreateNew, "Create", null, new{@class="HyperLinkNewText"}) %>
            </td>
        </tr>
        <tr>
            <td>	
				<% using (Ajax.BeginForm(null, null, new AjaxOptions { UpdateTargetId = "ClienteWorkWithDiv" }, new { id = "ClienteWorkWithForm" }))
					{	%>
				<%= Html.Hidden("Prompt") %>
				<%= Html.Hidden("ReturnItems") %>
				<input id="ClienteWorkWithSubmit" type="submit" style="display:none" />
				<div id="ClienteWorkWithDiv">
					<% Html.RenderPartial("WorkWithControl"); %>
				</div>			    
				<% } %>
            </td>
        </tr>
    </table>
    <div class="divContactList-bottom">
        &nbsp;</div>

</asp:Content>
